Method of and device for identifying direction of characters in image block

ABSTRACT

The present embodiments disclose a method of and device for identifying the direction of characters in an image block. The method includes: performing optical character recognition processing on the image block by assuming various directions as assumed character directions to obtain sub image blocks, recognized characters corresponding to the sub image blocks and correctness measures thereof in each assumed character directions; in sub image blocks in the assumed character directions with  180 ° mutual relation, searching for a minimum matching pair of the sub image blocks; adjusting the sub image blocks in the searched minimum matching pair to eliminate the effect, on an identification result, of different numbers of sub image blocks in various assumed character directions; calculating an accumulative correctness measure in each assumed character directions based on the adjusted sub image blocks; and identifying the direction of characters in the image block according to the accumulative correctness measures.

This application claims priority to Chinese Patent Application No.201110189288.8, filed on Jun. 29, 2011 and entitled “Method of andDevice for Identifying Direction of Characters in Image Block”, contentsof which are incorporated herein by reference in its entirety.

FIELD

The present embodiments generally relate to processing of a documentimage and in particular to a method of and device for identifying thedirection of characters in an image block.

BACKGROUND

When a user scans a stack of documents using a scanner or the like,every page of each document is placed upside up for an ideal input. Withthe documents placed upside up, the user can read the documents easily,and scanned images of the documents can be read by the user withoutadjusting their directions. However in a practical application, thedocuments to be scanned by the user tend to be placed alternatively atangles of 0° (upside up) and 180° (upside down) as well as 90° and 270°(transversely). It would be burdensome and time-consuming for the userto check and adjust the placement directions of the documentspage-by-page prior to their scanning. Therefore the scanner is designedwith a function of judging automatically the direction of a documentimage. With the function of judging automatically the direction of adocument image, the scanned document image can be adjusted to be placedupside up to thereby alleviate the burden on the user and improve theefficiency of usage by the user.

In a traditional method of judging automatically the direction of adocument image, a text line in the document image is located; OpticalCharacter Recognition (OCR) processing is performed respectively in fourpossible directions to obtain recognized characters and correspondingconfidences or recognition distances thereof in the four possibledirections; and the average confidence or the average recognitiondistance of the text line is calculated. The direction with the largestaverage confidence or the smallest average recognition distance isjudged as the direction of the text line, and the direction of thedocument image is further judged from the direction of the text line.The direction of the text line refers to the upside-up direction of thetext line, and the direction of the document image refers to theupside-up direction of the document image. Hereinafter, the characterdirection (or the direction of characters) refers to the upside-updirection of (the) characters.

SUMMARY

The following is the summary of the embodiments to facilitate a basicunderstanding of some aspects of the embodiments. However it shall beappreciated that this summary is not an extensive overview of theembodiments, and it is intended neither to identify certain crucial orimportant elements of the embodiments nor to delineate the scope of theembodiments. Rather, the primary purpose of the summary is to presentsome concepts of the embodiments in a simplified form prior to the moredetailed description that is presented hereinafter.

As illustrated in FIG. 1, an image block of a text line “TIP AMOUNT” isinput in the assumed 0° direction and is rotated by 180° to obtain animage block of the text line in the 180° direction. Since processes inthe directions of 90° and 270° are similar to those in the directions of0° and 180°, only the processes in the directions of 0° and 180° will bedescribed here as an example. OCR processing is performed respectivelyon the image blocks of the text line in the directions of 0° and 180° toobtain sub image blocks, recognized characters corresponding to the subimage blocks and confidences thereof in the two directions asillustrated in FIG. 1.

In the traditional method, the average confidence of the recognizedcharacters in the 0° direction equals to(0.54+0.36+0.48+0.61+0.71+0.61+0.58+0.65)/8=0.5675, and the averageconfidence of the recognized characters in the 180° direction equals to(0.62+0.58+0.65+0.62+0.40+0.50+0.61)/7=0.5686. Since 0.5675 is smallerthan 0.5686, the 180° direction (i.e., the direction with the higheraverage confidence) might be judged in error as the direction of thecharacters in the image block of the text line in the traditionalmethod.

The foregoing error arises because the image block in the 0° directionis divided into eight sub image blocks while the image block in the 180°direction is divided into seven sub image blocks, and the image blocksbefore and after rotation correspond to the same character contents, soa consequential error arises from division into different numbers of subimage blocks. Thus, the direction of the characters in the image blockis identified in error due to those different numbers of sub blocks.

An object of the embodiments is to address the foregoing problem byproposing a method and device capable of identifying correctly thedirection of characters in an image block. This solution can identifycorrectly the direction of characters in an image block regardless ofdifferent numbers of sub blocks resulting from OCR processing to therebyimprove the accuracy of judging automatically the direction of adocument image.

In order to attain the foregoing object, there is provided according toan aspect of the embodiments a method of identifying the direction ofcharacters in an image block, which includes: performing opticalcharacter recognition processing on the image block by assuming variousdirections as assumed character directions, respectively, to obtain subimage blocks, recognized characters corresponding to the sub imageblocks and correctness measures thereof in each of the assumed characterdirections; in sub image blocks in the assumed character directions witha 180° mutual relation therebetween, searching for a minimum matchingpair of the sub image blocks, wherein the minimum matching pair is twosets of sub image blocks in the assumed character directions with a 180°mutual relation therebetween, which have corresponding positions,identical sizes and a minimum number of sub image blocks; adjusting thesub image blocks in the searched minimum matching pair, to eliminate theeffect, on an identification result, of different numbers of sub imageblocks in the various assumed character directions; calculating anaccumulative correctness measure in each of the assumed characterdirections based on the adjusted sub image blocks; and identifying thedirection of the characters in the image block according to theaccumulative correctness measures.

According to an embodiment, the step of adjusting the sub image blocksin the searched minimum matching pair includes: when M sub image blocksin a assumed character direction in a minimum matching pair correspondto N sub image blocks in the other assumed character direction in theminimum matching pair and M≠N, adjusting the correctness measurescorresponding to the sub image blocks, wherein M and N are positiveintegers.

According to an embodiment, the step of adjusting the sub image blocksin the searched minimum matching pair includes: when M sub image blocksin a assumed character direction in a minimum matching pair correspondto N sub image blocks in the other assumed character direction in theminimum matching pair and M≠N, adjusting the number of sub image blocksso that the numbers of sub image blocks in the two assumed characterdirections in the minimum matching pair are identical, wherein M and Nare positive integers.

According to an embodiment, the step of adjusting the correctnessmeasures corresponding to the sub image blocks includes the steps of:multiplying the correctness measures of the M sub image blocks by C/M,and multiplying the correctness measures of the N sub image blocks byC/N, wherein C is the least common multiple of M and N; or, multiplyingthe correctness measures of the M sub image blocks by N, and multiplyingthe correctness measures of the N sub image blocks by M.

According to an embodiment, the step of adjusting the correctnessmeasures corresponding to the sub image blocks includes the step of:dividing the correctness measures of the M sub image blocks by M, anddividing the correctness measures of the N sub image blocks by N.

According to an embodiment, the step of adjusting the correctnessmeasures corresponding to the sub image blocks includes the step of:multiplying the correctness measures of the M sub image blocks by N/M.

According to an embodiment, the step of adjusting the number of subimage blocks so that the numbers of sub image blocks in the two assumedcharacter directions in the minimum matching pair are identical includesthe step of: duplicating each of the M sub image blocks into C/M ones,and duplicating each of the N sub image blocks into C/N ones, where C isthe least common multiple of M and N; or, duplicating each of the M subimage blocks into N ones, and duplicating each of the N sub image blocksinto M ones.

According to an embodiment, the step of adjusting the number of subimage blocks so that the numbers of sub image blocks in the two assumedcharacter directions in the minimum matching pair are identical includesthe step of: merging the M sub image blocks into N new sub image blocks,wherein a sum of correctness measures of the N new sub image blocks is asum of correctness measures of the M sub image blocks multiplied by N/M.

According to an embodiment, the step of adjusting the number of subimage blocks so that the numbers of sub image blocks in the two assumedcharacter directions in the minimum matching pair are identical includesthe step of: merging the M sub image blocks into a new sub image block,wherein a correctness measure of the new sub image block is anarithmetic average value of the correctness measures of the M sub imageblocks; and, merging the N sub image blocks into another new sub imageblock, wherein a correctness measure of the other new sub image block isan arithmetic average value of the correctness measures of the N subimage blocks.

According to an embodiment, the step of calculating an accumulativecorrectness measure in each of the assumed character directions based onthe adjusted sub image blocks includes the step of: dividing the sums ofthe correctness measures of the adjusted sub image blocks in each of theassumed character directions by the number of the minimum matching pairsin the corresponding assumed character directions as the accumulativecorrectness measures in the corresponding assumed character directions.

According to an embodiment, the correctness measure includes aconfidence or a recognition distance, and the various directions includetwo transverse directions and two longitudinal directions of the imageblock.

According to another aspect of the embodiments, there is provided adevice for identifying the direction of characters in an image block,which includes: an optical character recognition processing unitconfigured for performing optical character recognition processing onthe image block by assuming various directions as assumed characterdirections, respectively, to obtain sub image blocks, recognizedcharacters corresponding to the sub image blocks and correctnessmeasures thereof in each of the assumed character directions; a minimummatching pair searching unit configured for, in sub image blocks in theassumed character directions with a 180° mutual relation therebetween,searching for a minimum matching pair of the sub image blocks, whereinthe minimum matching pair is two sets of sub image blocks in the assumedcharacter directions with a 180° mutual relation therebetween, whichhave corresponding positions, identical sizes and a minimum number ofsub image blocks; a sub image block adjusting unit configured foradjusting the sub image blocks in the searched minimum matching pair, toeliminate the effect, on an identification result, of different numbersof sub image blocks in the various assumed character directions; anaccumulative correctness measure calculating unit configured forcalculating an accumulative correctness measure in each of the assumedcharacter directions based on the adjusted sub image blocks; and acharacter direction identifying unit configured for identifying thedirection of the characters in the image block according to theaccumulative correctness measures.

According to an embodiment, the sub image block adjusting unit includes:a sub image block correctness measure adjusting unit configured for,when M sub image blocks in a assumed character direction in a minimummatching pair correspond to N sub image blocks in the other assumedcharacter direction in the minimum matching pair and M≠N, adjusting thecorrectness measures corresponding to the sub image blocks, wherein Mand N are positive integers.

According to an embodiment, the sub image block adjusting unit includes:a sub image block number adjusting unit configured for, when M sub imageblocks in a assumed character direction in a minimum matching paircorrespond to N sub image blocks in the other assumed characterdirection in the minimum matching pair and MτN, adjusting the number ofsub image blocks so that the numbers of sub image blocks in the twoassumed character directions in the minimum matching pair are identical,wherein M and N are positive integers.

According to an embodiment, the accumulative correctness measurecalculating unit is configured for dividing the sums of the correctnessmeasures of the adjusted sub image blocks in each of the assumedcharacter directions by the number of the minimum matching pairs in thecorresponding assumed character directions as the accumulativecorrectness measures in the corresponding assumed character directions.

Furthermore, there is provided according to another aspect of theembodiments a storage medium including machine readable program codeswhich when being executed on an information processing device cause theinformation processing device to perform the foregoing method accordingto the embodiments.

Moreover, there is provided according to yet another aspect of theembodiments a program product including machine executable instructionswhich when being executed on an information processing device cause theinformation processing device to perform the foregoing method accordingto the embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other objects, features and advantages of theembodiments will become more apparent from the detailed descriptiongiven below in conjunction with the accompanying drawings in which thosecomponents are merely intended to illustrate the principle of theembodiments and throughout which identical or like technical features orcomponents are denoted with identical or like reference numerals. In thedrawings:

FIG. 1 illustrates sub image blocks, recognized characters andconfidences in the directions of 0° and 180° resulting from OCRprocessing of an image block of a text line;

FIG. 2 illustrates sub image blocks, recognized characters andrecognition distances in the directions of 0° and 180° resulting fromOCR processing of an image block of a text line;

FIG. 3 illustrates a flow chart of a method of identifying the directionof characters in an image block according to a first embodiment;

FIG. 4 illustrates a flow chart of a method of identifying the directionof characters in an image block according to a second embodiment;

FIG. 5 illustrates a flow chart of a method of identifying the directionof characters in an image block according to a third embodiment;

FIG. 6 illustrates a flow chart of a method of identifying the directionof characters in an image block according to a fourth embodiment;

FIG. 7 illustrates a structural block diagram of a device foridentifying the direction of characters in an image block according toan embodiment; and

FIG. 8 illustrates a schematic block diagram of a computer that can beused for implementing the method and device according to theembodiments.

DETAILED DESCRIPTION

Exemplary embodiments will be described below in conjunction with theaccompanying drawings. For the sake of clarity and conciseness, not allthe features of practical implementations will be described in thespecification. However, it shall be appreciated that during developingany of such practical implementations, numerous implementation-specificdecisions shall be made to achieve the developer's specific goals, forexample, to comply with those system- and business-related constrainingconditions which may vary from one implementation to another. Moreover,it shall also be appreciated that such a development job might be verycomplex and time-consuming but may simply be a routine task for thoseskilled in the art benefiting from this disclosure.

It shall further be noted that only those device structures and/orprocess steps closely relevant to the solutions of the embodiments willbe illustrated in the drawings while other details less relevant to theembodiments are omitted so as not to obscure the embodiments due tothose unnecessary details. Furthermore, it shall further be noted thatan element and a feature described in one of the drawings orimplementations of the embodiments can be combined with an element and afeature illustrated in one or more other drawings or implementations.

A flow of a method of identifying the direction of characters in animage block according to embodiments will be described below withreference to FIG. 3 to FIG. 6.

As assumed in this context, a text line has been located in a documentimage, and an image block containing the text line has been cropped fromthe document image. The embodiments are focused not upon how to locatethe text line in the document image but upon how to identify correctlythe direction of characters in the image block containing the text line.

It is typical to assume four main directions as assumed characterdirections, i.e., the direction of an image block itself (the 0°direction), the direction of the image block rotated by 180°, thedirection of the image block rotated by 90° and the direction of theimage block rotated by 270°, also referred to as two transversedirections and two longitudinal directions of the image block. Thedirections of 90° and 270° generally apply to possibly verticallywritten characters, e.g., of Chinese, Japanese, etc. Since a scenariowith the directions of 0° and 180° is similar to a scenario with thedirections of 90° and 270°, only the scenario with the directions of 0°and 180° will be described below as an example.

A flow of a method of identifying the direction of characters in animage block according to the first embodiment will be described belowwith reference to FIG. 3.

Firstly, OCR processing is performed by optical character recognitionprocessing unit on an image block by assuming 0° and 180° as assumedcharacter directions to obtain sub image blocks, recognized characterscorresponding to the sub image blocks and confidences thereof in thedirections of 0° and 180° (at S301). FIG. 1 illustrates an example ofthe sub image blocks which are numbered, the recognized characters andthe confidences in the directions of 0° and 180°. A recognition resultof OCR generally includes sub image blocks divided from the image blocksubjected to the OCR, recognized characters corresponding to the subimage blocks and correctness measures of the recognized characters. Acorrectness measure reflects the reliability of a recognized characterand is typically a confidence or a recognition distance. The higher theconfidence is, the higher possibility the recognized character iscorrect; and the shorter the recognition distance is, the higherpossibility the recognized character is correct. A description will bepresented in the first and second embodiments taking as an example arecognition result including a confidence. A description will bepresented in the third and fourth embodiments with respect to asituation in which a recognition result includes a recognition distance.

Next, the sub image blocks in the directions of 0° and 180° are searchedby minimum matching pair searching unit for a minimum matching pair ofthe sub image blocks (at S302). The minimum matching pair refers to twosets of sub image blocks in assumed character directions with a 180°mutual relation therebetween, which have corresponding positions,identical sizes and a minimum number of sub image blocks. The minimummatching pair includes such two sets of sub image blocks that the subimage blocks included in the two sets of sub image blocks are locatedrespectively in two assumed character directions with a 180° mutualrelation therebetween and the two sets of sub image blocks havecorresponding positions and identical sizes, that is, any one of the twosets of sub image blocks, after being rotated by 180° along with thetext line in which it is located, will superimpose upon the other set ofsub image blocks belonging to the same minimum matching pair. When thetwo sets of sub image blocks include a minimum number of sub imageblocks, the two sets of sub image blocks are referred to as constitutinga minimum matching pair. For example, P1 and N7 constitute a minimummatching pair in FIG. 1. Similarly, P2 and N6, P3 and P4 together withN5, P5 and N4, P6 and N3, P7 and N2, and P8 and N1 constituterespectively a minimum matching pair. There are numerous methods ofsearching for a minimum matching pair, for example, it is possible tosearch for a minimum matching pair sequentially from corresponding sidesof the two directions according to the definition of a minimum matchingpair. Specifically, the first sub image blocks P1 and N7 are locatedrespectively at the leftmost side of the 0° direction and the rightmostside of the 180° direction, and the two sub image blocks are judged asbeing of the same size, so P1 and N7 are determined as a minimummatching pair. Then the next sub image blocks P2 and N6 are furtherlocated in the two directions, and the two sub image blocks are judgedas being of the same size, so P2 and N6 are determined as a minimummatching pair. Thereafter the next sub image blocks P3 and N5 arefurther located in the two directions, and the two sub image blocks arejudged as being of different sizes, and then ,according to thedefinition of a minimum matching pair, the sub image block P4 is furtherlocated in the 0° direction of the smaller sub image block P3, a set ofsub image blocks including the sub image blocks P3 and P4 are comparedwith a set of sub image blocks including the sub image block N5 in size,and the two sets of sub image blocks are judged as being of the samesize, so the set of sub image blocks including the sub image blocks P3and P4 and the set of sub image blocks including the sub image block N5are determined as a minimum matching pair. This process is repeateduntil locating all the minimum matching pairs in the two assumedcharacter directions with a 180° mutual relationship therebetween.

As described above, the error arises because the image block in theassumed character directions with a 180° mutual relationshiptherebetween is divided into different numbers of sub image blocks afterOCR processing. The minimum matching pairs located at S302 can beconsidered as a result of further combination of the image blocks of thetext line. Since a minimum matching pair includes two sets of sub imageblocks of the same size and at corresponding locations, the division ofminimum matching pairs is surely correct and the two sets of sub imageblocks of the minimum matching pair correspond to the same charactercontents. Correspondingly, at the level of a minimum matching pair, ifthe two sets of sub image blocks in the two directions in the minimummatching pair include the same number of sub image blocks, then thedirection of the text line will not be judged in error due toinconsistent results of division, which is similar to the situation atthe level of the text line. If the two sets of sub image blocks in thetwo directions in the minimum matching pair include different numbers ofsub image blocks, then such results of division may result in incorrectjudgment of the direction of the text line. In other words, the root ofthe problem to be addressed by the embodiments lies in different numbersof divided-into sub image blocks resulting from OCR processing of thesame character contents in the different directions. Different numbersof sub image blocks included in the image block of the text line in thetwo different directions at the level of the text line are translatedinto different numbers of sub image blocks included in the sets of thesub image blocks in the two different directions at the level of aminimum matching pair through searching for the minimum matching pair.

Therefore, it is determined by sub image block correctness measureadjusting unit whether the numbers of sub image blocks in the twoassumed character directions in the minimum matching pair are identicalat S303. If so, then it indicates no inconsistent division has occurredand the flow goes to S305 for subsequent processing without anyadjustment; otherwise, the flow goes to S304 of adjusting by sub imageblock correctness measure adjusting unit the confidences correspondingto the sub image blocks in the minimum matching pair.

The confidences corresponding to the sub image blocks in the minimummatching pair are adjusted in order to eliminate the effect, on anidentification result, of different numbers of sub image blocks in therespective assumed character directions. There are numerous specificapproaches. Here, several illustrative implementations thereof will bepresented. It is assumed here that M sub image blocks in one of theassumed character directions in the minimum matching pair correspond toN sub image blocks in the other assumed character direction in theminimum matching pair, where M and N are positive integers. As notedabove, M=N indicates a correct division result of the sub image blocksand no adjustment is required. Therefore, the correctness measurescorresponding to the sub image blocks will be adjusted only for thesituation in which M″. In this embodiment, the correctness measure is aconfidence.

In a first approach, the confidences of the M sub image blocks aremultiplied by N, and the confidences of the N sub image blocks aremultiplied by M.

As illustrated in FIG. 1, there are different numbers of sub imageblocks in the two directions only in the minimum matching pair includingP3 and P4 together with N5, where M=2 and N=1. The confidences of bothP3 and P4 are multiplied by 1, and the confidence of N5 is multiplied by2 as a new confidence of N5, that is, the adjusted confidencecorresponding to N5 is 0.40*2=0.80.

In a second approach, each of the confidences of the M sub image blocksis multiplied by C/M, and each of the confidences of the N sub imageblocks is multiplied by C/N, where C is the least common multiple of Mand N.

In the example of FIG. 1, M and N are relatively prime numbers. With M=4and N=3, the correctness measures of the M sub image blocks can bemultiplied by N and the correctness measures of the N sub image blockscan be multiplied by M in the first approach. However, it will beapparently preferable to alternatively calculate the least commonmultiple C of M and N and multiply the correctness measures of the M subimage blocks by C/M and multiply the correctness measures of the N subimage blocks by C/N.

In a third approach, each of the confidences of the M sub image blocksis divided by M, and each of the confidences of the N sub image blocksis divided by N.

As illustrated in FIG. 1, there are different numbers of sub imageblocks in the two directions only in the minimum matching pair includingP3 and P4 together with N5, where M=2 and N=1. The confidences of bothP3 and P4 are divided by 2 as new confidences of P3 and P4, that is, theadjusted confidences corresponding to P3 and P4 are 0.24 and 0.305respectively, and the confidence of N5 is divided by 1 as a newconfidence of N5.

In a fourth approach, the confidences of the M sub image blocks aremultiplied by N/M.

As illustrated in FIG. 1, there are different numbers of sub imageblocks in the two directions only in the minimum matching pair includingP3 and P4 together with N5, where M=2 and N=1. The confidences of bothP3 and P4 are multiplied by ½ as new confidences of P3 and P4, that is,the adjusted confidences corresponding to P3 and P4 are 0.24 and 0.305respectively, and the confidence of N5 is divided by 1 as a newconfidence of N5.

After the confidences of the minimum matching pair which includesdifferent numbers of sub image blocks in the sets of sub image blocks inthe two directions thereof are adjusted by sub image block correctnessmeasure adjusting unit at S304, the adjusted confidences are obtained,and the flow goes to S305 of calculating by accumulative correctnessmeasure calculating unit an accumulative confidence in each of theassumed character directions based on the adjusted confidences andidentifying by character direction identifying unit the direction of thecharacters in the image block of the text line according to theaccumulative confidences.

An accumulative confidence is a correctness measure characterizing anrecognition result of the image block of the text line in a direction asa whole. An accumulative confidence is generally calculated in twospecific approaches. The sum of confidences corresponding to each of subimage blocks in an assumed character direction can be calculated as anaccumulative confidence in that direction. Alternatively, the arithmeticaverage value of confidences corresponding to each of sub image blocksin an assumed character direction can be calculated as an accumulativeconfidence in that direction. A direction with a higher accumulativeconfidence is more likely to be a correct identification result.

At S304, the effect, on an identification result, of different numbersof sub image blocks in the respective assumed character directions iseliminated by adjusting the confidences of the sub image blocks in theminimum matching pair so that the confidences of the two sets of subimage blocks as a whole in the minimum matching pair have bettercomparability in all the first to fourth approaches. For an accumulativeconfidence which is the calculated sum of confidences, the confidencesin the direction with a smaller number of sub image blocks are increasedor the confidences in the direction with a larger number of sub imageblocks are decreased so that the accumulative confidences in the twodirections (the sums of the confidences in the respective directions)have higher reliability. For an accumulative confidence which is thecalculated average of confidences, the sum of confidences which is thenumerator is equivalently adjusted, and apparently if there aredifferent denominators to calculate the accumulative confidences in thetwo directions, then the different denominators still reflect thedifferent numbers of sub image blocks in the respective assumedcharacter directions and thereby bring a negative effect upon anidentification result. Therefore, in the first embodiment a consistentdenominator shall be kept to calculate the arithmetic average value ofconfidences as an accumulative confidence. The number of unadjusted subimage blocks in any direction can be taken, e.g., 7 or 8 in the exampleas illustrated in FIG. 1. Preferably, the number of minimum matchingpairs in an assumed character direction is taken, which physically meansthat sets of sub image blocks in a minimum matching pair are taken as anelementary unit of a result of dividing the image block of the text lineand the apparent confidences of the two sets of sub image blocks as awhole in the minimum matching pair are adjusted. Apparently, it ispreferable here to take the number of minimum matching pairs as thedenominator to calculate the average of confidences.

Apparently the one with the highest accumulative confidence among therespective assumed character directions shall be judged as the directionof a correct identification result.

In an example where an accumulative confidence is the sum of allconfidences in an assumed character direction, the accumulativeconfidences calculated in the first to fourth approaches at S304 arerespectively:

In the first approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.48+0.61+0.71+0.61+0.58+0.65=4.54

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.80+0.50+0.61=4.38

In the second approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.48+0.61+0.71+0.61+0.58+0.65=4.54

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.80+0.50+0.61=4.38

In the third approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.24+0.305+0.71+0.61+0.58+0.65=3.995

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.40+0.50+0.61=3.98

In the fourth approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.24+0.305+0.71+0.61+0.58+0.65=3.995

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.40+0.50+0.61=3.98

Apparently, the accumulative confidence in the 0° direction is alwayshigher than the accumulative confidence in the 180° direction after theconfidences are adjusted in the four approaches. If the average ofconfidences is calculated through division by 7, i.e., the number ofminimum matching pairs, then apparently the accumulative confidence inthe 0° direction will also be always higher than the accumulativeconfidence in the 180° direction. Therefore, the effect, on anidentification result, of different numbers of sub image blocks in therespective assumed character directions can be eliminated.

A flow of a method of identifying the direction of characters in animage block according to the second embodiment will be described belowwith reference to FIG. 4.

S401 to S403 and S405 are the same respectively as S301 to S303 and S305of the first embodiment above, and therefore a repeated descriptionthereof will be omitted here. A major difference of the secondembodiment from the first embodiment lies in that the numbers of subimage blocks in the two sets of sub image blocks in the minimum matchingpair are adjusted so that the numbers of sub image blocks in the twosets of sub image blocks are identical.

As described above, the error arises because the image block in theassumed character directions with a 180° mutual relationshiptherebetween is divided into different numbers of sub image blocks afterOCR processing. Different numbers of sub image blocks included in theimage block of the text line in the two different directions at thelevel of the text line are translated into different numbers of subimage blocks included in the sets of sub image blocks in the twodifferent directions at the level of a minimum matching pair throughsearching for the minimum matching pairs at S402. In the firstembodiment, the apparent confidences of the sets of sub image blocks asa whole in the two directions in the minimum matching pair are adjusted,but there are still different numbers of divided-into sub image blocksin the respective assumed character directions, so the average ofconfidences is calculated by taking preferably the number of minimummatching pairs as the numerator or taking another numerator of anidentical value to thereby derive a correct identification result. Sincethe root of the problem lies in different numbers of sub image blocks inthe sets of sub image blocks in the two directions in the minimummatching pair, the inventors have realized that the technical problem tobe addressed by the embodiments can be addressed by adjusting the numberof sub image blocks in the two assumed character directions in theminimum matching pair to be identical.

At S404, the numbers of sub image blocks in the minimum matching pairare adjusted so that the numbers of sub image blocks in the two assumedcharacter directions in the minimum matching pair are identical toeliminate the effect, on an identification result, of different numbersof sub image blocks in the respective assumed character directions.There are numerous specific approaches. Here, several illustrativeimplementations thereof will be presented. It is assumed here that M subimage blocks in one of the assumed character directions in the minimummatching pair correspond to N sub image blocks in the other assumedcharacter direction in the minimum matching pair, where M and N arepositive integers. As noted above, M=N indicates a correct divisionresult of the sub image blocks and no adjustment is required. Therefore,the correctness measures corresponding to the sub image blocks will beadjusted only for situation in which M≠N. In this embodiment, thecorrectness measure is a confidence.

In a first approach, each of the M sub image blocks is duplicated into Nones, and each of the N sub image blocks is duplicated into M ones.

It shall be noted that duplication means that each sub image block to beduplicated is duplicated M or N times into M or N identical duplicatedsub image blocks without changing the confidence of the sub imageblocks. Moreover, duplication here is primarily for the purpose ofjudging a correct character direction but does not means occurrence of aplurality of identical duplicated characters among the recognizedcharacters corresponding to the text line.

As illustrated in FIG. 1, there are different numbers of sub imageblocks in the two directions only in the minimum matching pair includingP3 and P4 together with N5, where M=2 and N=1. N5 is duplicated into twoones so that there are two sub image blocks N5 in the 180° direction andthe confidence of each N5 is 0.4.

In a second approach, each of the M sub image blocks is duplicated intoC/M ones, and each of the N sub image blocks is duplicated into C/Nones, where C is the least common multiple of M and N.

In the example illustrated in FIG. 1, M and N are relatively primenumbers. With M=4 and N=6, each of the M sub image blocks is duplicatedinto N ones, and each of the N sub image blocks is duplicated into Mones in the first approach. However, it will be apparently preferable toalternatively calculate the least common multiple C of M and N andduplicate each of the M sub image blocks into C/M ones and duplicateeach of the N sub image blocks into C/N ones. For example, C=12 givenM=4 and N=6, so each of the four sub image blocks is duplicated intothree ones and each of the six sub image blocks is duplicated into twoones.

In a third approach, the M sub image blocks are merged into N new subimage blocks, and the sum of the confidences of the N new sub imageblocks is the sum of the confidences of the M sub image blocksmultiplied by N/M.

As illustrated in FIG. 1, there are different numbers of sub imageblocks in the two directions only in the minimum matching pair includingP3 and P4 together with N5, where M=2 and N=1. P3 and P4 are merged intoa new sub image block P34 with a confidence being the sum of theconfidences corresponding to P3 and P4 divided by 2, i.e.,(0.48+0.61)/2=0.545.

The third approach will not be limited to any specific implementation.For example, assuming M>N, a number (M−N+1) of immediately adjacent subimage blocks among the M sub image blocks can be merged into a new subimage block without charging the remaining (N−1) sub image blocksthemselves, and the confidences of the respective resulting N sub imageblocks can be set to the average value of the confidences of theoriginal M sub image blocks. Apparently, other sub image block mergingapproaches and other confidence adjusting approaches can alternativelybe adopted so long as such two conditions are satisfied that “the M subimage blocks are merged into N new sub image blocks” and “the sum of theconfidences of the N new sub image blocks is the sum of the confidencesof the M sub image blocks multiplied by N/M”. The new N sub image blockssatisfying the two conditions are consistent with the correspondingassumed character direction in terms of the number of sub image blocksand possess adjusted confidences with better comparability. Thus, thereis no incorrect judgment of the direction of the text line due toinconsistent division results.

In a fourth approach, the M sub image blocks are merged into a new subimage block with a confidence being the arithmetic average value of theconfidences of the M sub image blocks; and the N sub image blocks aremerged into another new sub image block with a confidence being thearithmetic average value of the confidences of the N sub image blocks.

As illustrated in FIG. 1, there are different numbers of sub imageblocks in the two directions only in the minimum matching pair includingP3 and P4 together with N5, where M=2 and N1=1. P3 and P4 are mergedinto a new sub image block P34 with a confidence being the arithmeticaverage value of the confidences of P3 and P4, i.e.,(0.48+0.61)/2=0.545. N5 is not changed due to N=1.

At S404, the sub image blocks are duplicated or merged by sub imageblock number adjusting unit so that the sets of sub image blocks in thetwo directions of the minimum matching pair include the same number ofsub image blocks, and the apparent confidences of the minimum matchingpair as a whole are also adjusted along with duplicating or merging ofthe sub image blocks. Thereafter, the flow goes to S405 of calculatingby accumulative correctness measure calculating unit an accumulativeconfidence in each of the assumed character directions based on theadjusted sub image blocks and identifying by character directionidentifying unit the direction of the characters in the image block ofthe text line according to the accumulative confidences.

At S404, the effect, on an identification result, of different numbersof sub image blocks in the respective assumed character directions iseliminated by performing duplicating or merging in order for the samenumber of sub image blocks in the two directions in the minimum matchingpair so that the confidences in the two directions have bettercomparability in all the first to fourth approaches. For an accumulativeconfidence which is the calculated sum of confidences, duplicating ormerging is performed so that the accumulative confidences in the twodirections (the sums of the confidences in the respective directions)have higher reliability. For an accumulative confidence which is thecalculated average of confidences, the sum of confidences which is thenumerator is equivalently adjusted, and further to the first embodiment,the numbers of sub image blocks are also adjusted to be consistent, sothe number of the adjusted sub image blocks can be taken as thedenominator to calculate the average of confidences. Alike, the numberof minimum matching pairs in an assumed character direction can still betaken as the denominator. Similarly, among the various assumed characterdirections, the assumed character direction with the highestaccumulative confidence shall be judged as the direction of a correctidentification result.

In an example where an accumulative confidence is the sum of allconfidences in an assumed character direction, the accumulativeconfidences calculated in the first to fourth approaches at 404 arerespectively:

In the first approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.48+0.61+0.71+0.61+0.58+0.65=4.54

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.40+0.40+0.50+0.61=4.38

In the second approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.48+0.61+0.71+0.61+0.58+0.65=4.54

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.40+0.40+0.50+0.61=4.38

In the third approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.545+0.71+0.61+0.58+0.65=3.995

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.40+0.50+0.61=3.98

In the fourth approach:

Accumulative confidence in the 0°direction=0.54+0.36+0.545+0.71+0.61+0.58+0.65=3.995

Accumulative confidence in the 180°direction=0.62+0.58+0.65+0.62+0.40+0.50+0.61=3.98

Apparently, the accumulative confidence in the 0° direction is alwayshigher than the accumulative confidence in the 180° direction after thesub image blocks are duplicated or merged in the four approaches. If theaverage of confidences is calculated through division by 7, i.e., thenumber of minimum matching pairs or by the number of adjusted sub imageblocks, then apparently the accumulative confidence in the 0° directionwill still be always higher than the accumulative confidence in the 180°direction. Therefore, the effect, on an identification result, ofdifferent numbers of sub image blocks in the respective assumedcharacter directions can be eliminated.

The third and fourth embodiments will be described below with referenceto FIG. 2, FIG. 5 and FIG. 6.

As described above, a recognition result of OCR generally includesdivided-into sub image blocks, recognized characters corresponding tothe sub image blocks and correctness measures of the recognizedcharacters. A correctness measure reflects the reliability of arecognized character and is typically a confidence or a recognitiondistance. The description has been presented above in the first andsecond embodiments taking as an example a recognition result including aconfidence. A description will be presented in the third and fourthembodiments with respect to the situation in which a recognition resultincludes a recognition distance. FIG. 2 illustrates an example of subimage blocks which are numbered, recognized characters and recognitiondistances in the directions of 0° and 180°.

As illustrated in FIG. 2, the average recognition distance of therecognized characters in the 0° direction equals to(928+1279+1034+774+578+779+840+695)/8=863.4, and the average recognitiondistance of the recognized characters in the 180° direction equals to(759+840+704+769+1087+1005+790)/7=850.6, in the traditional method.Since 850.6 is smaller than 863.4, the 180° direction (i.e., thedirection with a smaller average recognition distance) might be judgedin error as the direction of the characters in the image block of thetext line in the traditional method. Alike, this error arises fromdifferent results of dividing “AM” in the directions of 0° and 180°.There are eight resulting sub blocks in the 0° direction and sevenresulting sub blocks in the 180° direction.

This problem arises because the image block is divided into differentnumbers of sub image blocks, and the method according to the embodimentscan address the effect, on an identification result, of differentnumbers of sub image blocks, so the idea described in the first andsecond embodiments will also apply to a scenario in which an recognitionresult includes a recognition distance instead of a confidence.

A flow of a method of identifying the direction of characters in animage block according to the third embodiment will be described belowwith reference to FIG. 5. The method according to the third embodimentis similar to the method according to the first embodiment.

Firstly, OCR processing is performed by optical character recognitionprocessing unit on an image block by assuming 0° and 180° as assumedcharacter directions to obtain sub image blocks, recognized characterscorresponding to the sub image blocks and recognition distances thereofin the directions of 0° and 180° (S501).

Next, the sub image blocks in the directions of 0° and 180° aresearching by minimum matching pair searching unit for a minimum matchingpair of the sub image blocks (S502). For example, P1 and N7 constitute aminimum matching pair in FIG. 1. Similarly, P2 and N6, P3 and P4together with N5, P5 and N4, P6 and N3, P7 and N2, and P8 and N1constitute respectively a minimum matching pair.

It is determined by sub image block correctness measure adjusting unitwhether the numbers of sub image blocks in the two assumed characterdirections in the minimum matching pair are identical at S503. If so,then it indicates no inconsistent division has occurred and the flowgoes to S505 for subsequent processing without any adjustment;otherwise, the flow goes to S504 of adjusting by sub image blockcorrectness measure adjusting unit the recognition distancescorresponding to the sub image blocks in the minimum matching pair.

The recognition distances corresponding to the sub image blocks in theminimum matching pair are adjusted in order to eliminate the effect, onan identification result, of different numbers of sub image blocks inthe respective assumed character directions. There are numerous specificapproaches. Here, several illustrative implementations thereof will bepresented. It is assumed here M sub image blocks in one of the assumedcharacter directions in the minimum matching pair correspond to N subimage blocks in the other assumed character direction in the minimummatching pair, where M and N are positive integers. As noted above, M=Nindicates a correct division result of the sub image blocks and noadjustment is required. Therefore, the correctness measurescorresponding to the sub image blocks will be adjusted only for thesituation in which NUN. In this embodiment, the correctness measure is arecognition distance.

In a first approach, the recognition distances of the M sub image blocksare multiplied by N, and the recognition distances of the N sub imageblocks are multiplied by M.

In a second approach, each of the recognition distances of the M subimage blocks is multiplied by C/M, and each of the recognition distancesof the N sub image blocks is multiplied by C/N, where C is the leastcommon multiple of M and N.

In a third approach, each of the recognition distances of the M subimage blocks is divided by M, and each of the recognition distances ofthe N sub image blocks is divided by N.

In a fourth approach, the recognition distances of the M sub imageblocks are multiplied by N/M.

After the recognition distances of the minimum matching pair whichincludes different numbers of sub image blocks in the sets of sub imageblocks in the two directions are adjusted by sub image block correctnessmeasure adjusting unit at S504, the adjusted recognition distances areobtained, and the flow goes to S505 of calculating by accumulativecorrectness measure calculating unit an accumulative recognitiondistance in each of the assumed character directions based on theadjusted recognition distances and identifying by character directionidentifying unit the direction of the characters in the image block ofthe text line according to the accumulative recognition distances.

An accumulative recognition distance is a correctness measurecharacterizing an identification result of the image block of the textline in a direction as a whole. The sum of recognition distancescorresponding to all sub image blocks in an assumed character directioncan be calculated as an accumulative recognition distance in thatdirection. Alternatively, the arithmetic average value of recognitiondistances corresponding to all sub image blocks in an assumed characterdirection can be calculated as an accumulative recognition distance inthat direction. A direction with a shorter accumulative recognitiondistance is more likely to be a correct identification result.

For an accumulative recognition distance which is the calculated sum ofrecognition distances, the recognition distances in the direction with asmaller number of sub image blocks are increased or the recognitiondistances in the direction with a larger number of sub image blocks aredecreased so that the accumulative recognition distances in the twodirections (the sums of the recognition distances in the respectivedirections) have higher reliability. For an accumulative recognitiondistance which is the calculated average of recognition distances, thesum of recognition distances which is the numerator is equivalentlyadjusted, and apparently if there are different denominators tocalculate the accumulative recognition distances in the two directions,then the different denominators still reflect the different numbers ofsub image blocks in the respective assumed character directions andthereby bring a negative influence upon an identification result.Therefore, in the third embodiment a consistent denominator shall bekept to calculate the arithmetic average value of recognition distancesas an accumulative recognition distance. The number of unadjusted subimage blocks in any direction can be taken, e.g., 7 or 8 in the exampleas illustrated in FIG. 2. Preferably, the number of minimum matchingpairs in an assumed character direction is taken, which physically meansthat sets of sub image blocks in a minimum matching pair are taken as anelementary unit of a result of dividing the image block of the text lineand the apparent recognition distances of the two sets of sub imageblocks as a whole in the minimum matching pair are adjusted. Apparently,it is preferable here to take the number of minimum matching pairs asthe denominator to calculate the average of recognition distances.

Apparently, the one with the shorter accumulative recognition distanceamong the respective assumed character directions shall be judged as thedirection of a correct identification result.

With the recognition distance adjusted according to the above mentionedfirst approach to fourth approach, the accumulative recognition distancein the direction of 0° is always longer than the accumulativerecognition distance in the direction of 180°. Thus, a correctidentification result can be derived.

A flow of a method of identifying the direction of characters in animage block according to the fourth embodiment will be described belowwith reference to FIG. 6.

S601 to S603 and S605 are the same respectively as S501 to S503 and S505of the third embodiment above, and therefore a repeated descriptionthereof will be omitted here. A major difference of the fourthembodiment from the third embodiment lies in that the numbers of subimage blocks in the two sets of sub image blocks in the minimum matchingpair are adjusted so that the numbers of sub image blocks in the twosets of sub image blocks are identical.

At S604, the numbers of sub image blocks in the minimum matching pairare adjusted by sub image block number adjusting unit in order toeliminate the effect, on an identification result, of different numbersof sub image blocks in the respective assumed character directions.There are numerous specific approaches. Here, several illustrativeimplementations thereof will be presented. It is assumed here that M subimage blocks in one of the assumed character directions in the minimummatching pair correspond to N sub image blocks in the other assumedcharacter direction in the minimum matching pair, where M and N arepositive integers. As noted above, M=N indicates a correct divisionresult of the sub image blocks and no adjustment is required. Therefore,the correctness measures corresponding to the sub image blocks will beadjusted only for the situation in which //1WN. In this embodiment, thecorrectness measure is a recognition distance.

In a first approach, each of the M sub image blocks is duplicated into Nones, and each of the N sub image blocks is duplicated into M ones.

It shall be noted that duplication means that each sub image block to beduplicated is duplicated M or N times into M or N identical duplicatedsub image blocks without changing the recognition distances of theduplicated sub image blocks. Moreover, duplication here is primarily forthe purpose of judging a correct character direction but does not meansoccurrence of a plurality of identical duplicated characters among therecognized characters corresponding to the text line.

In a second approach, each of the M sub image blocks is duplicated intoC/M ones, and each of the N sub image blocks is duplicated into C/Nones, where C is the least common multiple of M and N.

In a third approach, the M sub image blocks are merged into N new subimage blocks, and the sum of the recognition distances of the N new subimage blocks is the sum of the recognition distances of the M sub imageblocks multiplied by N/M.

The third approach will not be limited to any specific implementation.For example, assuming M>N, then (M−N+1) immediately adjacent sub imageblocks among the M sub image blocks can be merged into a new sub imageblock without changing the remaining (N−1) sub image blocks themselves,and the recognition distances of the respective resulting N sub imageblocks can be set to the average value of the recognition distances ofthe original M sub image blocks. Apparently, other sub image blockmerging approaches and other recognition distance adjusting approachescan alternatively be adopted so long as such two conditions aresatisfied that “the M sub image blocks are merged into N new sub imageblocks” and “the sum of the recognition distances of the N new sub imageblocks is the sum of the recognition distances of the M sub image blocksmultiplied by N/M”. The new N sub image blocks satisfying the twoconditions are consistent with the corresponding assumed characterdirection in terms of the number of sub image blocks and possessadjusted recognition distances with better comparability. Thus, there isno incorrect judgment of the direction of the text line due toinconsistent division results.

In a fourth approach, the M sub image blocks are merged into a new subimage block with a recognition distance being the arithmetic averagevalue of the recognition distances of the M sub image blocks; and the Nsub image blocks are merged into another new sub image block with arecognition distance being the arithmetic average value of therecognition distances of the N sub image blocks.

At S604, the effect, on an identification result, of different numbersof sub image blocks in the respective assumed character directions iseliminated by performing duplicating or merging in order for the samenumber of sub image blocks in the two directions in the minimum matchingpair, so that the recognition distances in the two directions havebetter comparability in all the first to fourth approaches. For anaccumulative recognition distance which is the calculated sum ofrecognition distances, duplicating or merging is performed so that theaccumulative recognition distances in the two directions (the sums ofthe recognition distances in the respective directions) have higherreliability. For an accumulative recognition distance which is thecalculated average of recognition distances, the sum of recognitiondistances which is the numerator is equivalently adjusted, and furtherto the third embodiment, the numbers of sub image blocks are alsoadjusted to be consistent, so each of the numbers of the adjusted subimage blocks can be taken as the denominator to calculate the average ofrecognition distances. Alike, the number of minimum matching pairs in anassumed character direction can also be taken as the denominator.Similarly, the one with the smallest accumulative recognition distanceamong the assumed character directions shall be judged as the directionof a correct identification result.

A structure of an identifying device for identifying the direction ofcharacters in an image block according to an embodiment will bedescribed below with reference to FIG. 7. As illustrated in FIG. 7, theidentifying device 700 for identifying the direction of characters in animage block includes: an optical character recognition processing unit701 configured for performing optical character recognition processingon the image block by assuming various directions as assumed characterdirections, respectively, to obtain sub image blocks, recognizedcharacters corresponding to the sub image blocks and correctnessmeasures thereof in each of the assumed character directions; a minimummatching pair searching unit 702 configured for, in sub image blocks inthe assumed character directions with a 180° mutual relationtherebetween, searching for a minimum matching pair of the sub imageblocks, wherein the minimum matching pair is two sets of sub imageblocks in the assumed character directions with a 180° mutual relationtherebetween, which have corresponding positions, identical sizes and aminimum number of sub image blocks; a sub image block adjusting unit 703configured for adjusting the sub image blocks in the searched minimummatching pair, to eliminate the effect, on an identification result, ofdifferent numbers of sub image blocks in the various assumed characterdirections; an accumulative correctness measure calculating unit 704configured for calculating an accumulative correctness measure in eachof the assumed character directions based on the adjusted sub imageblocks; and a character direction identifying unit 705 configured foridentifying the direction of the characters in the image block accordingto the accumulative correctness measures.

Since processing in the optical character recognition processing unit701, the minimum matching pair searching unit 702, the sub image blockadjusting unit 703, the accumulative correctness measure calculatingunit 704 and the character direction identifying unit 705 included inthe identifying device 700 according to the embodiments is similarrespectively to processing at S301-S305, S401-S405, S501-S505 andS601-S605 of the method for identifying the direction of characters inan image block described above, a detailed description of these unitswill be omitted here for the sake of conciseness.

Furthermore, it shall be noted that the respective constituent modulesand units in the foregoing device can be configured in software,firmware, hardware or a combination thereof. Specific configurationmeans or approaches are well known to those skilled in the art, and arepeated description thereof will be omitted here. In the case of beingimplemented in software or firmware, a program constituting the softwareis installed from the storage medium or network to a computer with adedicated hardware structure (e.g., a general-purpose computer 800illustrated in FIG. 8, etc.), which can perform various functions whenvarious programs are installed thereon.

In FIG. 8, a Central Processing Unit (CPU) 801 performs variousprocesses according to a program stored in a Read Only Memory (ROM) 802or loaded from a storage part 808 into a Random Access Memory (RAM) 803in which data required when the CPU 801 performs the various processesis also stored as needed. The CPU 801, the ROM 802 and the RAM 803 areconnected to each other via a bus 804 to which an input/output interface805 is also connected.

The following components are connected to the input/output interface805: an input part 806 (including a keyboard, a mouse, etc.; an outputpart 807 including a display, e.g., a Cathode Ray Tube (CRT), a LiquidCrystal Display (LCD), etc., a speaker, etc.), a storage part 808(including a hard disk, etc.) and a communication part 809 (including anetwork interface card, e.g., an LAN card, a modem, etc.) Thecommunication part 809 performs a communication process over a network,e.g., the Internet. A drive 810 is also connected to the input/outputinterface 805 as needed. A removable medium 811, e.g., a magnetic disk,an optical disk, an optic-magnetic disk, a semiconductor memory, etc.,can be installed on the drive 810 as needed so that a computer programfetched therefrom can be installed into the storage part 808 as needed.

In the case that the foregoing series of processes are implemented bysoftware, a program constituting the software is installed from thenetwork, e.g., the Internet, etc., or a storage medium, e.g., theremovable medium 811, etc.

Those skilled in the art shall appreciate that such a storage mediumwill not be limited to the removable medium 811 illustrated in FIG. 8 inwhich the program is stored and which is distributed separately from thedevice to provide a user with the program. Examples of the removablemedium 811 include a magnetic disk (including a Floppy Disk (aregistered trademark)), an optical disk (including Compact Disk-ReadOnly memory (CD-ROM) and a Digital Versatile Disk (DVD)), anoptic-magnetic disk (including a Mini Disk (MD) (a registeredtrademark)) and a semiconductor memory. Alternatively, the storagemedium can be the ROM 802, the hard disk included in the storage part808, etc., in which the program is stored and which is distributedtogether with the device including the same to the user.

Furthermore, the embodiments further propose a program product includingmachine readable instruction codes which can perform the foregoingmethod according to the embodiments when being read and executed by amachine.

Correspondingly, a storage medium on which the program product includingmachine readable instruction codes is embodied will also be encompassedin the disclosure. The storage medium includes but will not be limitedto a floppy disk, an optical disk, an optic-magnetic disk, a memorycard, a memory stick, etc.

In the foregoing description of the embodiments, a feature describedand/or illustrated in an embodiment can be used identically or similarlyin one or more other embodiments in combination with or in place of afeature in the other embodiment(s).

It shall be noted that the terms “include/comprise” and their variantsas used in this context refer to presence of a feature, an element, astep or a component but do not preclude presence or addition of one ormore other features, elements, steps or components.

Furthermore, the method according to the embodiments will not be limitedto being performed in the temporal sequence described in thespecification but can also be performed in other temporal sequences,concurrently or separately. Therefore, the sequence in which the methodis performed described in the specification will not limit the scope ofthe embodiments.

Although the embodiments have been disclosed above in the description ofthe embodiments, it shall be appreciated that all the foregoingembodiments and examples are illustrative but not limitative. Thoseskilled in the art can devise various modifications, adaptations orequivalents to the embodiments without departing from the spirit andscope of the appended claims. These modifications, adaptations orequivalents shall also be construed as coming into the scope of theembodiments.

Annexes

Annex 1. A method of identifying the direction of characters in an imageblock, including the steps of:

performing optical character recognition processing on the image blockby assuming various directions as assumed character directions,respectively, to obtain sub image blocks, recognized characterscorresponding to the sub image blocks and correctness measures thereofin each of the assumed character directions;

in sub image blocks in the assumed character directions with a 180°mutual relation therebetween, searching for a minimum matching pair ofthe sub image blocks, wherein the minimum matching pair is two sets ofsub image blocks in the assumed character directions with a 180° mutualrelation therebetween, which have corresponding positions, identicalsizes and a minimum number of sub image blocks;

adjusting the sub image blocks in the searched minimum matching pair, toeliminate the effect, on an identification result, of different numbersof sub image blocks in the various assumed character directions;

calculating an accumulative correctness measure in each of the assumedcharacter directions based on the adjusted sub image blocks; and

identifying the direction of the characters in the image block accordingto the accumulative correctness measures.

Annex 2. The method according to Annex 1, wherein the step of adjustingthe sub image blocks in the searched minimum matching pair includes thesteps of:

when M sub image blocks in a assumed character direction in a minimummatching pair correspond to N sub image blocks in the other assumedcharacter direction in the minimum matching pair and M≠N, adjusting thecorrectness measures corresponding to the sub image blocks, wherein Mand N are positive integers.

Annex 3. The method according to Annex 1, wherein the step of adjustingthe sub image blocks in the searched minimum matching pair includes thesteps of:

when M sub image blocks in a assumed character direction in a minimummatching pair correspond to N sub image blocks in the other assumedcharacter direction in the minimum matching pair and M≠N, adjusting thenumber of sub image blocks so that the numbers of sub image blocks inthe two assumed character directions in the minimum matching pair areidentical, wherein M and N are positive integers.

Annex 4. The method according to Annex 2, wherein the step of adjustingthe correctness measures corresponding to the sub image blocks includesthe steps of:

multiplying the correctness measures of the M sub image blocks by C/M,and multiplying the correctness measures of the N sub image blocks byC/N, wherein C is the least common multiple of M and N; or, multiplyingthe correctness measures of the M sub image blocks by N, and multiplyingthe correctness measures of the N sub image blocks by M.

Annex 5. The method according to Annex 2, wherein the step of adjustingthe correctness measures corresponding to the sub image blocks includesthe step of:

dividing the correctness measures of the M sub image blocks by M, anddividing the correctness measures of the N sub image blocks by N.

Annex 6. The method according to Annex 2, wherein the step of adjustingthe correctness measures corresponding to the sub image blocks includesthe step of:

multiplying the correctness measures of the M sub image blocks by N/M.

Annex 7. The method according to Annex 3, wherein the step of adjustingthe number of sub image blocks so that the numbers of sub image blocksin the two assumed character directions in the minimum matching pair areidentical includes the step of: duplicating each of the M sub imageblocks into C/M ones, and duplicating each of the N sub image blocksinto C/N ones, where C is the least common multiple of M and N; or,duplicating each of the M sub image blocks into N ones, and duplicatingeach of the N sub image blocks into M ones.

Annex 8. The method according to Annex 3, wherein the step of adjustingthe number of sub image blocks so that the numbers of sub image blocksin the two assumed character directions in the minimum matching pair areidentical includes the step of: merging the M sub image blocks into Nnew sub image blocks, wherein a sum of correctness measures of the N newsub image blocks is a sum of correctness measures of the M sub imageblocks multiplied by N/M.

Annex 9. The method according to Annex 3, wherein the step of adjustingthe number of sub image blocks so that the numbers of sub image blocksin the two assumed character directions in the minimum matching pair areidentical includes the step of: merging the M sub image blocks into anew sub image block, wherein a correctness measure of the new sub imageblock is an arithmetic average value of the correctness measures of theM sub image blocks; and, merging the N sub image blocks into another newsub image block, wherein a correctness measure of the other new subimage block is an arithmetic average value of the correctness measuresof the N sub image blocks.

Annex 10. The method according to any one of Annexes 1 to 9, wherein thestep of calculating an accumulative correctness measure in each of theassumed character directions based on the adjusted sub image blocksincludes the step of: dividing the sums of the correctness measures ofthe adjusted sub image blocks in each of the assumed characterdirections by the number of the minimum matching pairs in thecorresponding assumed character directions as the accumulativecorrectness measures in the corresponding assumed character directions.

Annex 11. The method according to any one of Annexes 1 to 9, wherein thecorrectness measure includes a confidence or a recognition distance, andthe various directions include two transverse directions and twolongitudinal directions of the image block.

Annex 12. A device for identifying the direction of characters in animage block, including:

an optical character recognition processing unit configured forperforming optical character recognition processing on the image blockby assuming various directions as assumed character directions,respectively, to obtain sub image blocks, recognized characterscorresponding to the sub image blocks and correctness measures thereofin each of the assumed character directions;

a minimum matching pair searching unit configured for, in sub imageblocks in the assumed character directions with a 180° mutual relationtherebetween, searching for a minimum matching pair of the sub imageblocks, wherein the minimum matching pair is two sets of sub imageblocks in the assumed character directions with a 180° mutual relationtherebetween, which have corresponding positions, identical sizes and aminimum number of sub image blocks;

a sub image block adjusting unit configured for adjusting the sub imageblocks in the searched minimum matching pair, to eliminate the effect,on an identification result, of different numbers of sub image blocks inthe various assumed character directions;

an accumulative correctness measure calculating unit configured forcalculating an accumulative correctness measure in each of the assumedcharacter directions based on the adjusted sub image blocks; and

a character direction identifying unit configured for identifying thedirection of the characters in the image block according to theaccumulative correctness measures.

Annex 13. The device according to Annex 12, wherein the sub image blockadjusting unit includes:

a sub image block correctness measure adjusting unit configured for,when M sub image blocks in a assumed character direction in a minimummatching pair correspond to N sub image blocks in the other assumedcharacter direction in the minimum matching pair and M≠N, adjusting thecorrectness measures corresponding to the sub image blocks, wherein Mand N are positive integers.

Annex 14. The device according to Annex 12, wherein the sub image blockadjusting unit includes:

a sub image block number adjusting unit configured for, when M sub imageblocks in a assumed character direction in a minimum matching paircorrespond to N sub image blocks in the other assumed characterdirection in the minimum matching pair and M≠N, adjusting the number ofsub image blocks so that the numbers of sub image blocks in the twoassumed character directions in the minimum matching pair are identical,wherein M and N are positive integers.

Annex 15. The device according to any one of Annexes 12 to 14, whereinthe accumulative correctness measure calculating unit is configured fordividing the sums of the correctness measures of the adjusted sub imageblocks in each of the assumed character directions by the number of theminimum matching pairs in the corresponding assumed character directionsas the accumulative correctness measures in the corresponding assumedcharacter directions.

1. A method of identifying a direction of characters in an image block,comprising: performing optical character recognition processing on theimage block by assuming various directions as assumed characterdirections, respectively, to obtain sub image blocks, recognizedcharacters corresponding to the sub image blocks and correctnessmeasures in each of the assumed character directions; in sub imageblocks in the assumed character directions with a 180° mutual relationtherebetween, searching for a minimum matching pair of the sub imageblocks, wherein the minimum matching pair is two sets of sub imageblocks in the assumed character directions with a 180° mutual relationtherebetween, which have corresponding positions, identical sizes and aminimum number of sub image blocks; adjusting the sub image blocks inthe searched minimum matching pair, to eliminate an effect, on anidentification result, of different numbers of sub image blocks in theassumed character directions; calculating an accumulative correctnessmeasure in each of the assumed character directions based on adjustedsub image blocks; and identifying the direction of the characters in theimage block according to the accumulative correctness measures.
 2. Themethod according to claim 1, wherein the adjusting the sub image blocksin the searched minimum matching pair comprises: when M sub image blocksin a assumed character direction in a minimum matching pair correspondto N sub image blocks in another assumed character directions in theminimum matching pair and M≠N, adjusting the correctness measurescorresponding to the sub image blocks, wherein M and N are positiveintegers.
 3. The method according to claim 1, wherein the adjusting thesub image blocks in the searched minimum matching pair comprises: when Msub image blocks in a assumed character direction in a minimum matchingpair correspond to N sub image blocks in another assumed characterdirections in the minimum matching pair and M≠N, adjusting the number ofsub image blocks so that the numbers of sub image blocks in the twoassumed character directions in the minimum matching pair are identical,wherein M and N are positive integers.
 4. The method according to claim2, wherein the adjusting the correctness measures corresponding to thesub image blocks comprises: multiplying the correctness measures of theM sub image blocks by C/M, and multiplying the correctness measures ofthe N sub image blocks by C/N, wherein C is a least common multiple of Mand N; or, multiplying the correctness measures of the M sub imageblocks by N, and multiplying the correctness measures of the N sub imageblocks by M.
 5. The method according to claim 2, wherein the adjustingthe correctness measures corresponding to the sub image blockscomprises: dividing the correctness measures of the M sub image blocksby M, and dividing the correctness measures of the N sub image blocks byN.
 6. The method according to claim 2, wherein the adjusting thecorrectness measures corresponding to the sub image blocks comprises:multiplying the correctness measures of the M sub image blocks by N/M.7. The method according to claim 3, wherein the step of adjusting thenumber of sub image blocks so that the numbers of sub image blocks inthe two assumed character directions in the minimum matching pair areidentical comprises: duplicating each of the M sub image blocks into C/Mimage blocks, and duplicating each of the N sub image blocks into C/Nones, where C is the least common multiple of M and N; or, duplicatingeach of the M sub image blocks into N image blocks, and duplicating eachof the N sub image blocks into M ones.
 8. The method according to claim3, wherein the adjusting the number of sub image blocks so that numbersof sub image blocks in the two assumed character directions in theminimum matching pair are identical comprises: merging the M sub imageblocks into N new sub image blocks, wherein a sum of correctnessmeasures of the N new sub image blocks is a sum of correctness measuresof the M sub image blocks multiplied by N/M.
 9. The method according toclaim 3, wherein the adjusting the number of sub image blocks so thatthe numbers of sub image blocks in the two assumed character directionsin the minimum matching pair are identical comprises: merging the M subimage blocks into a new sub image block, wherein a correctness measureof the new sub image block is an arithmetic average value of thecorrectness measures of the M sub image blocks; and, merging the N subimage blocks into another new sub image block, wherein a correctnessmeasure of the another new sub image block is an arithmetic averagevalue of the correctness measures of the N sub image blocks.
 10. Themethod according to claim 1, wherein the calculating an accumulativecorrectness measure in each of the assumed character directions based onthe adjusted sub image blocks comprises: dividing sums of correctnessmeasures of the adjusted sub image blocks in each of the assumedcharacter directions by a number of the minimum matching pairs in thecorresponding assumed character directions as the accumulativecorrectness measures in the corresponding assumed character directions.11. The method according to claim 1, wherein the correctness measurecomprises one of a confidence and a recognition distance, and thevarious directions comprise two transverse directions and twolongitudinal directions of the image block.
 12. A device for identifyingthe direction of characters in an image block, comprising: an opticalcharacter recognition processing unit configured for performing opticalcharacter recognition processing on the image block by assuming variousdirections as assumed character directions, respectively, to obtain subimage blocks, recognized characters corresponding to the sub imageblocks and correctness measures thereof in each of the assumed characterdirections; a minimum matching pair searching unit configured for, insub image blocks in the assumed character directions with a 180° mutualrelation therebetween, searching for a minimum matching pair of the subimage blocks, wherein the minimum matching pair is two sets of sub imageblocks in the assumed character directions with a 180° mutual relationtherebetween, which have corresponding positions, identical sizes and aminimum number of sub image blocks; a sub image block adjusting unitconfigured for adjusting the sub image blocks in the searched minimummatching pair, to eliminate the effect, on an identification result, ofdifferent numbers of sub image blocks in the various assumed characterdirections; an accumulative correctness measure calculating unitconfigured for calculating an accumulative correctness measure in eachof the assumed character directions based on the adjusted sub imageblocks; and a character direction identifying unit configured foridentifying a direction of the characters in the image block accordingto the accumulative correctness measures.
 13. The device according toclaim 12, wherein the sub image block adjusting unit comprises: a subimage block correctness measure adjusting unit configured for, when Msub image blocks in a assumed character direction in a minimum matchingpair correspond to N sub image blocks in another assumed characterdirection in the minimum matching pair and M≠N, adjusting thecorrectness measures corresponding to the sub image blocks, wherein Mand N are positive integers.
 14. The device according to claim 12,wherein the sub image block adjusting unit comprises: a sub image blocknumber adjusting unit configured for, when M sub image blocks in aassumed character direction in a minimum matching pair correspond to Nsub image blocks in another assumed character direction in the minimummatching pair and M≠N, adjusting the number of sub image blocks so thatthe numbers of sub image blocks in the two assumed character directionsin the minimum matching pair are identical, wherein M and N are positiveintegers.
 15. The device according to claim 12, wherein the accumulativecorrectness measure calculating unit is configured for dividing sums ofthe correctness measures of the adjusted sub image blocks in each of theassumed character directions by a number of the minimum matching pairsin the corresponding assumed character directions as the accumulativecorrectness measures in the corresponding assumed character directions.